package com.yunupmall.mapper.commoditymapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunupmall.api.fordentity.Brand;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface BrandMapper extends BaseMapper<Brand> {
    @Select("select * from brand limit #{thisSize},#{pageSize}")
    List<Brand> queryDate(@Param("thisSize") Integer thisSize, @Param("pageSize") Integer pageSize);

    @Select("select count(*) from brand")
    int queryCount();

    @Insert("insert into brand(b_name)values(#{name})")
    int addData(@Param("name") String brandName);

    //删除品牌
    @Delete("delete from brand where id=#{id}")
    int deleteDate(@Param("id") Integer id);

    //查询所有品牌信息
    @Select("select * from brand where deflag=0")
    List<Brand> queryBrandData();
}
